a = int(input())
b = [0,0,0,0 ]
if a%2==0 and (a>4 and a<=12) :
    b[0] = 1
if a%2==0 or (a>4 and a<=12):
    b[1] = 1
if (a%2!=0 and (a>4 and a<=12 ))or (a%2==0 and not (a>4 and a<=12 )):
    b[2] = 1
if a%2==0 and not (a>4 and a<=12):
    b[3] = 1
for answer in b:
    print(answer)